.chat-page {
  display: flex;
  height: 100vh;
  color: white;
  position: relative;
  overflow: hidden;
}

/* 背景动画效果 */
.chat-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 226, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

/* 侧边栏样式 */
.chat-sidebar {
  width: 300px;
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.sidebar-header::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(97, 220, 163, 0.5), transparent);
}

.sidebar-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  background: linear-gradient(135deg, #fff 0%, #61dca3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 在.sidebar-header样式之后添加搜索框样式 */
.search-box {
  width: calc(100% - 16px);
  margin: 8px 8px 16px 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(30, 30, 30, 0.6);
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.search-box:focus {
  outline: none;
  border-color: #61dca3;
  box-shadow: 0 0 0 2px rgba(97, 220, 163, 0.2);
  background-color: rgba(40, 40, 40, 0.7);
}

.search-box::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.new-chat-btn {
  background: linear-gradient(135deg, #61dca3 0%, #4ecdc4 100%);
  color: #000;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(97, 220, 163, 0.3);
}

.new-chat-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.new-chat-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(97, 220, 163, 0.4);
}

.new-chat-btn:hover::before {
  left: 100%;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  /* 添加主题适配 */
  background-color: rgba(30, 30, 30, 0.6);
  border-radius: 16px;
  margin: 0 8px 8px 8px;
}

.conversation-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  backdrop-filter: blur(10px);
  background-color: rgba(30, 30, 30, 0.6);
}

.conversation-item:hover {
  transform: translateX(4px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  background-color: rgba(40, 40, 40, 0.7);
}

.conversation-item.active {
  background: linear-gradient(135deg, rgba(97, 220, 163, 0.15) 0%, rgba(78, 205, 196, 0.1) 100%);
  border-color: rgba(97, 220, 163, 0.5);
  box-shadow: 0 4px 15px rgba(97, 220, 163, 0.2);
}

.conversation-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(97, 220, 163, 0.1), transparent);
  transition: left 0.6s;
  border-radius: 12px;
}

.conversation-item:hover::before {
  left: 100%;
}

.conversation-title {
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 14px;
}

.conversation-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 107, 107, 0.8);
  color: white;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.conversation-item:hover .delete-btn {
  opacity: 1;
}

.delete-btn:hover {
  background: #ff5252;
}

/* 主聊天区域 */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h3 {
  margin: 0;
  font-size: 18px;
}

.model-info {
  display: flex;
  gap: 10px;
  font-size: 14px;
}

.provider {
  background: rgba(97, 220, 163, 0.2);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.model-name {
  color: rgba(255, 255, 255, 0.8);
}

/* 消息容器 */
.messages-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  max-width: 80%;
  animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  align-self: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

.message-content {
  padding: 16px 20px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.message-text {
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 14px;
  position: relative;
  z-index: 1;
}

/* 流式文本打字效果 */
.message.streaming .message-text {
  animation: typewriter 0.5s steps(40) 1s 1 normal both;
}

@keyframes typewriter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.message-time {
  font-size: 11px;
  margin-top: 4px;
}

/* 流式响应动画 */
.message.streaming .message-content {
  animation: pulse 2s infinite, glow 3s ease-in-out infinite;
}

@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); }
  50% { box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2); }
}

.typing-indicator {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  align-items: center;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { 
    transform: scale(0.5); 
    opacity: 0.3; 
  }
  40% { 
    transform: scale(1.2); 
    opacity: 1; 
  }
}

/* 输入区域 */
.chat-input-container {
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  position: relative;
}

.chat-input-container::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(97, 220, 163, 0.5), transparent);
}

.chat-input {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  position: relative;
}

.chat-input textarea {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 16px 20px;
  color: white;
  resize: none;
  min-height: 52px;
  max-height: 150px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.chat-input textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

.chat-input textarea:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
}

.chat-input textarea:focus {
  outline: none;
  border-color: #61dca3;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(97, 220, 163, 0.15), 0 8px 32px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.send-btn {
  background: linear-gradient(135deg, #61dca3 0%, #4ecdc4 100%);
  color: #000;
  border: none;
  padding: 16px 24px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: 52px;
  min-width: 80px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(97, 220, 163, 0.3);
}

.send-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.send-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 30px rgba(97, 220, 163, 0.4);
}

.send-btn:hover:not(:disabled)::before {
  left: 100%;
}

.send-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 无对话状态 */
.no-conversation {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 40px;
}

.no-conversation h3 {
  margin: 0 0 16px 0;
  font-size: 24px;
  font-weight: 600;
  background: linear-gradient(135deg, #fff 0%, #61dca3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: float 4s ease-in-out infinite;
}

.no-conversation p {
  margin: 0 0 24px 0;
  font-size: 16px;
  line-height: 1.6;
  max-width: 400px;
}

/* 起始对话按钮 */
.start-chat-btn {
  background: linear-gradient(135deg, #61dca3 0%, #4ecdc4 100%);
  color: #000;
  border: none;
  padding: 16px 32px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(97, 220, 163, 0.3);
  position: relative;
  overflow: hidden;
}

.start-chat-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.start-chat-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 30px rgba(97, 220, 163, 0.4);
}

.start-chat-btn:hover::before {
  left: 100%;
}

/* 模态框样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 32px;
  width: 420px;
  max-width: 90vw;
  animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(97, 220, 163, 0.5), transparent);
}

.modal h3 {
  margin: 0 0 24px 0;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  background: linear-gradient(135deg, #fff 0%, #61dca3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-group {
  margin-bottom: 24px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.form-group input,
.form-group select {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px 16px;
  color: white;
  font-size: 15px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.form-group input:hover,
.form-group select:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #61dca3;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(97, 220, 163, 0.15);
  transform: translateY(-1px);
}

.form-group select option {
  background: #2a2a2a;
  color: white;
  padding: 12px;
}

/* 表单组动画 */
.form-group::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #61dca3, #4ecdc4);
  transition: width 0.3s ease;
}

.form-group:focus-within::after {
  width: 100%;
}

.modal-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  margin-top: 32px;
}

.modal-actions button {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.modal-actions button:first-child {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.modal-actions button:first-child:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.modal-actions button:last-child {
  background: linear-gradient(135deg, #61dca3 0%, #4ecdc4 100%);
  color: #000;
  box-shadow: 0 4px 15px rgba(97, 220, 163, 0.3);
}

.modal-actions button:last-child:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(97, 220, 163, 0.4);
}

.modal-actions button:last-child:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 按钮光效动画 */
.modal-actions button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.modal-actions button:hover::before {
  left: 100%;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .chat-page {
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }
  
  .chat-sidebar {
    width: 100%;
    height: 180px;
    min-height: 180px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }
  
  .sidebar-header {
    padding: 16px;
  }
  
  .sidebar-header h3 {
    font-size: 16px;
  }
  
  .conversation-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 12px;
  }
  
  .conversation-item {
    min-width: 220px;
    margin-bottom: 0;
    padding: 12px;
  }
  
  .conversation-title {
    font-size: 13px;
  }
  
  .conversation-meta {
    font-size: 11px;
  }
  
  .chat-main {
    height: calc(100vh - 180px);
  }
  
  .chat-header {
    padding: 16px;
  }
  
  .chat-header h3 {
    font-size: 16px;
  }
  
  .model-info {
    display: none;
  }
  
  .messages-container {
    padding: 16px;
    gap: 12px;
  }
  
  .message {
    max-width: 90%;
  }
  
  .message-content {
    padding: 12px 16px;
  }
  
  .message-text {
    font-size: 13px;
  }
  
  .chat-input-container {
    padding: 16px;
  }
  
  .chat-input {
    gap: 12px;
  }
  
  .chat-input textarea {
    min-height: 48px;
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .send-btn {
    height: 48px;
    padding: 12px 20px;
    min-width: 70px;
  }
  
  /* 模态框移动端优化 */
  .modal {
    margin: 20px;
    padding: 24px;
  }
  
  .modal h3 {
    font-size: 18px;
  }
  
  .modal-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .modal-actions button {
    width: 100%;
  }
  
  /* 无对话状态移动端优化 */
  .no-conversation {
    padding: 20px;
  }
  
  .no-conversation h3 {
    font-size: 20px;
  }
  
  .no-conversation p {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .chat-sidebar {
    height: 160px;
  }
  
  .conversation-item {
    min-width: 180px;
    padding: 10px;
  }
  
  .chat-main {
    height: calc(100vh - 160px);
  }
  
  .messages-container {
    padding: 12px;
    gap: 8px;
  }
  
  .message {
    max-width: 95%;
  }
  
  .message-content {
    padding: 10px 14px;
  }
  
  .chat-input-container {
    padding: 12px;
  }
  
  .chat-input textarea {
    min-height: 44px;
    padding: 10px 14px;
  }
  
  .send-btn {
    height: 44px;
    padding: 10px 16px;
    min-width: 60px;
    font-size: 13px;
  }
}

/* ===== 额外的CSS动画和微交互效果 ===== */

/* 自定义滚动条样式 */
.conversation-list::-webkit-scrollbar,
.messages-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.conversation-list::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track {
  border-radius: 4px;
}

.conversation-list::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb {
  border-radius: 4px;
  transition: background 0.3s ease;
}

.conversation-list::-webkit-scrollbar-thumb:hover,
.messages-container::-webkit-scrollbar-thumb:hover {
  transition: background 0.3s ease;
}

/* 加载动画 */
.loading-pulse {
  animation: pulse 2s infinite;
}

/* 淡入淡出动画 */
.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.fade-out {
  animation: fadeOut 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* 消息发送时的微动画 */
.message-sending {
  animation: messageSend 0.3s ease-out;
}

@keyframes messageSend {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 按钮点击效果 */
.btn-click {
  animation: btnClick 0.2s ease-out;
}

@keyframes btnClick {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

/* 文本选中效果 */
.message-text::selection {
  color: white;
}

/* 无障碍优化 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 粒子效果背景 */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  border-radius: 50%;
}

/* 消息容器 */
.messages-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  max-width: 80%;
  animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  align-self: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

/* 流式响应动画 */
.message.streaming .message-content {
  animation: pulse 2s infinite, glow 3s ease-in-out infinite;
}

@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); }
  50% { box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2); }
}

.typing-indicator {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  align-items: center;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { 
    transform: scale(0.5); 
    opacity: 0.3; 
  }
  40% { 
    transform: scale(1.2); 
    opacity: 1; 
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .message {
    max-width: 90%;
  }
  
  .message-text {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .message {
    max-width: 95%;
  }
}

/* ===== 额外的CSS动画和微交互效果 ===== */

/* 自定义滚动条样式 */
.conversation-list::-webkit-scrollbar,
.messages-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.conversation-list::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track {
  border-radius: 4px;
}

.conversation-list::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb {
  border-radius: 4px;
  transition: background 0.3s ease;
}

.conversation-list::-webkit-scrollbar-thumb:hover,
.messages-container::-webkit-scrollbar-thumb:hover {
  transition: background 0.3s ease;
}

/* 加载动画 */
.loading-pulse {
  animation: pulse 2s infinite;
}

/* 淡入淡出动画 */
.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.fade-out {
  animation: fadeOut 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* 消息发送时的微动画 */
.message-sending {
  animation: messageSend 0.3s ease-out;
}

@keyframes messageSend {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 按钮点击效果 */
.btn-click {
  animation: btnClick 0.2s ease-out;
}

@keyframes btnClick {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

/* 文本选中效果 */
.message-text::selection {
  color: white;
}

/* 无障碍优化 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
